<?php
namespace App\Http\Controllers\Validator;
use Validator;

/**
 * Class DepartmentVali
 * @package App\Http\Controllers\Validator
 *部门表验证器
 */
class DepartmentVali{

    public static function validate($params)
    {
        $return = true;
        $validator = Validator::make($params, [
            'name'   => 'required',
            'type'   => 'required',
            'to_work_time' => 'required',
            'after_work_time' => 'required'

        ]);
        if ($validator->fails()) {
            $return = false;
        }
        return $return;
    }

    public static function editPermission($params)
    {
        $return = true;
        $validator = Validator::make($params, [
            'id'   => 'required',
            'd_authories' => 'required',

        ]);
        if ($validator->fails()) {
            $return = false;
        }
        return $return;
    }
}